// TTS组件样式
.tts-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  z-index: 1000;
  overflow-y: auto;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  padding: 20px;
  box-sizing: border-box;
}

.tts-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  
  .tts-title {
    font-size: 24px;
    font-weight: bold;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
  }
  
  .close-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    
    &:hover {
      background: rgba(255, 255, 255, 0.3);
      transform: scale(1.1);
    }
  }
}

.error-panel {
  margin-bottom: 20px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #ffcccc;
  border-radius: 12px;
  color: #d63031;
  font-weight: 500;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  backdrop-filter: blur(10px);
}

// 通用面板样式
.connection-panel,
.text-panel,
.params-panel,
.audio-panel,
.logs-panel {
  margin-bottom: 20px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.panel-title {
  font-size: 18px;
  font-weight: bold;
  color: #333;
  margin-bottom: 15px;
  display: block;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

// 连接状态
.connection-status {
  display: flex;
  align-items: center;
  
  .status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
  }
  
  &.status-disconnected .status-dot {
    background: #6c757d;
  }
  
  &.status-connecting .status-dot {
    background: #ffc107;
    animation: pulse 1.5s infinite;
  }
  
  &.status-connected .status-dot {
    background: #28a745;
  }
  
  .status-text {
    font-size: 14px;
    font-weight: 500;
    color: #495057;
  }
}

@keyframes pulse {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(1.3);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

// 按钮样式
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  
  &::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
  }
  
  &:hover:not(.btn-disabled)::before {
    left: 100%;
  }
  
  &.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    
    &:hover:not(.btn-disabled) {
      transform: translateY(-2px);
      box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
    }
  }
  
  &.btn-danger {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
    
    &:hover:not(.btn-disabled) {
      transform: translateY(-2px);
      box-shadow: 0 6px 20px rgba(255, 107, 107, 0.6);
    }
  }
  
  &.btn-small {
    padding: 8px 16px;
    font-size: 12px;
  }
  
  &.btn-disabled {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
    box-shadow: none;
  }
  
  &.btn-synthesis {
    width: 100%;
    margin-top: 15px;
    padding: 15px;
    font-size: 16px;
  }
}

.button-group {
  display: flex;
  gap: 15px;
}

// 文本输入
.text-input-container {
  position: relative;
  margin-bottom: 10px;
  
  .text-input {
    width: 100%;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #f8f9fa;
    
    &:focus {
      border-color: #667eea;
      background: white;
      box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    }
  }
  
  .text-counter {
    position: absolute;
    bottom: -25px;
    right: 0;
    font-size: 12px;
    color: #6c757d;
  }
}

// 参数设置
.param-group {
  margin-bottom: 25px;
  
  .param-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #495057;
    margin-bottom: 10px;
  }
  
  .param-slider {
    width: 100%;
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    
    .wx-slider-thumb {
      width: 20px;
      height: 20px;
      background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
      box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
    }
    
    .wx-slider-track {
      background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    }
  }
}

// 音色选择
.voice-selector {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  
  .voice-btn {
    padding: 10px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    background: #f8f9fa;
    color: #495057;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    
    &:hover {
      border-color: #667eea;
      background: rgba(102, 126, 234, 0.1);
    }
    
    &.voice-btn-active {
      border-color: #667eea;
      background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
      color: white;
      box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    }
  }
}

// 音频播放器
.audio-container {
  .audio-player {
    width: 100%;
    margin-bottom: 10px;
  }
  
  .audio-info {
    text-align: center;
    color: #28a745;
    font-size: 14px;
    font-weight: 500;
  }
}

.audio-placeholder {
  text-align: center;
  padding: 40px;
  color: #6c757d;
  font-style: italic;
  background: #f8f9fa;
  border-radius: 8px;
  border: 2px dashed #dee2e6;
}

// 日志面板
.logs-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.logs-content {
  max-height: 250px;
  overflow-y: auto;
  background: #f8f9fa;
  border-radius: 8px;
  padding: 15px;
  
  .log-entry {
    display: flex;
    margin-bottom: 8px;
    font-size: 13px;
    
    .log-time {
      color: #6c757d;
      margin-right: 10px;
      min-width: 80px;
      font-family: 'Courier New', monospace;
    }
    
    .log-message {
      color: #495057;
      flex: 1;
      word-break: break-word;
    }
  }
}

// 滚动条样式
.logs-content::-webkit-scrollbar {
  width: 6px;
}

.logs-content::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.logs-content::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
  
  &:hover {
    background: #a8a8a8;
  }
}

// 响应式设计
@media (max-width: 768px) {
  .tts-container {
    padding: 10px;
  }
  
  .tts-header {
    .tts-title {
      font-size: 20px;
    }
  }
  
  .connection-panel,
  .text-panel,
  .params-panel,
  .audio-panel,
  .logs-panel {
    padding: 15px;
  }
  
  .button-group {
    flex-direction: column;
    
    .btn {
      width: 100%;
    }
  }
  
  .voice-selector {
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 8px;
    
    .voice-btn {
      padding: 8px 12px;
      font-size: 12px;
    }
  }
  
  .logs-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}

@media (max-width: 480px) {
  .voice-selector {
    grid-template-columns: 1fr 1fr;
  }
  
  .param-group {
    margin-bottom: 20px;
  }
}